package Day36.test2;

public class Account {
    private long id;
    private double balance;
    private String password;
    private static long num=1;

    public Account(double balance, String password) {
        id = num++;//为id属性赋值
        this.balance = balance;
        this.password = password;
    }

    public long getId() {
        return id;
    }

    public double getBalance() {
        return balance;
    }

    public String getPassword() {
        return password;
    }

    @Override
    public String toString() {
        return "Account{" +
                "id=" + id +
                ", balance=" + balance +
                ", password='" + password + '\'' +
                '}';
    }
}
